$(document).ready(function(){
    $("#addBtn").button().css("width","200px");
    
    // now it 'overprofiles' page, loginza_widget should be removed
    //var lw = document.getElementById('loginza_widget');
    //lw.parentNode.removeChild(lw);
    //lw=null;
    
    $("#loginza_widget_new").dialog({
        autoOpen:false,
        closeOnEscape:true,
        position:["center",200],
        width:380,
        height:350,
        draggable:false,
        resizable:false,
        modal:true
    });
    
    $("#addBtn").click(function(){
        $("#loginza_widget_new").dialog("open");
    });
});

function removeBtn(div_close)
{   
    if(confirm('Are you sure?')){
        var id_provider = div_close.getAttribute('id_provider');
        var div_provider = div_close.parentNode;
        
        $.get('removeprovider/id/'+id_provider,
            function(data){
                div_provider.parentNode.removeChild(div_provider);
            }
        );
    }
}